package com.teach.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.teach.entity.user;
import com.teach.service.UserService;
import com.teach.service.impl.UserServiceImpl; 


public class UserListServlet extends HttpServlet{
    private UserService userService = new UserServiceImpl();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		List<user> list = userService.list();
		request.setAttribute("list", list);
		request.getRequestDispatcher("/admin/user-list.jsp").forward(request, response);      //注意更改地址
	}
	
}
